package org.common.utils.generatormapper.source;

/**
 * 来源对象
 */
public class Source {

    private SourceEnum sourceEnum;

    private Object arg;

    public static Source of(SourceEnum sourceEnum) {
        return of(sourceEnum , null);
    }

    public static Source of(SourceEnum sourceEnum, Object arg) {
        Source source = new Source();
        source.sourceEnum = sourceEnum;
        source.arg = arg;
        return source;
    }

    public SourceEnum getSourceEnum() {
        return sourceEnum;
    }

    public <T> T getArg() {
        return (T)arg;
    }
}
